<?php

/**
 * Languages
 * 
 * @package Delcampe
 * @author Kamalitha
 * @copyright 2009
 * @version 1.0
 * @access public
 */
class model_languages
{
	private $_db;

  	public function __construct()
  	{
    	$this->db = Zend_Registry::get('db');
  	}
  	
  	/**
  	 * Languages::getAllLanguages()
  	 * 
  	 * @return mixed
  	 */
  	public function getAllLanguages()
  	{
  		try 
	  	{
	   		return $this->db->fetchAll("SELECT lang_id, language_txt, is_published, is_supported FROM languages",null);
	  	}
	  	catch(Exception $ex)
	  	{
	   		return null;
	  	}
  	}
  	
  	/**
	 * Languages::getSupportedLanguages()
	 * 
	 * @return mixed
	 */
	public function getSupportedLanguages()
  	{
  		try 
	  	{
	   		return $this->db->fetchAll("SELECT language_id, language_txt, is_published, is_supported FROM languages where is_supported = 1");
	  	}
	  	catch(Exception $ex)
	  	{
	   		return null;
	  	}
  	}
}